<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="DC.Type" content="reference">
<meta name="DC.Title" content="sender Template Class">
<meta name="DC.subject" content="sender Template Class">
<meta name="keywords" content="sender Template Class">
<meta name="DC.Relation" scheme="URI" content="../../reference/flow_graph.htm">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="sender_cls">
<meta name="DC.Language" content="en-US">
<link rel="stylesheet" type="text/css" href="../../intel_css_styles.css">
<title>sender Template Class</title>
</head>
<body id="sender_cls">
 <!-- ==============(Start:NavScript)================= -->
 <script src="..\..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
 <script language="JavaScript1.2" type="text/javascript">WriteNavLink(2);</script>
 <!-- ==============(End:NavScript)================= -->
<a name="sender_cls"><!-- --></a>

 
  <h1 class="topictitle1">sender Template Class</h1>
 
   
  <div> 
	 <div class="section"><h2 class="sectiontitle">Summary</h2> 
		 
		<p>An abstract base class for nodes that act as message senders. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">Syntax</h2> 
		 
		<pre>template&lt; typename T &gt; class sender;</pre> 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">Header</h2> 
		 
		<pre>#include "tbb/flow_graph.h"</pre> 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">Description</h2> 
		 
		<p>The 
		  <span class="keyword">sender</span> template class is an abstract base class that
		  defines the interface for nodes that can act as senders. Default
		  implementations for several functions are provided. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">Members</h2> 
		 
		<pre>namespace tbb {
namespace flow {
 
template&lt; typename T &gt;
class sender {
public:
    typedef T output_type;
    typedef receiver&lt;output_type&gt; successor_type;
    virtual ~sender();
    virtual bool register_successor( successor_type &amp;r ) = 0;
    virtual bool remove_successor( successor_type &amp;r ) = 0;
    virtual bool try_get( output_type &amp;v ) { return false; }
    virtual bool try_reserve( output_type &amp;v ) { return false; }
    virtual bool try_release( ) { return false; }
    virtual bool try_consume( ) { return false; }
};
 
}
}</pre> 
		
<div class="tablenoborder"><table cellpadding="4" summary="" frame="border" border="1" cellspacing="0" rules="all"><span class="tabledesc">The following table provides additional information on the
			 members of this template class. 
		  </span><thead align="left"> 
				<tr> 
				  <th class="cellrowborder" valign="top" width="33.89830508474576%" id="d83130e114">Member 
				  </th>
 
				  <th class="cellrowborder" valign="top" width="66.10169491525423%" id="d83130e117">Description 
				  </th>
 
				</tr>
</thead>
 
			 <tbody> 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d83130e114 "><span class="keyword">~sender()</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d83130e117 "> 
					 <p>The destructor. 
					 </p>
 
				  </td>
 
				</tr>
 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d83130e114 "><span class="keyword">bool register_successor(
						successor_type &amp;r ) = 0</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d83130e117 "> 
					 <p>A pure virtual method that describes the interface for
						adding a successor node to the set of successors for the sender. 
					 </p>
 
					 <p> 
						<strong>Returns</strong>: 
						<span class="keyword">true</span> if the successor is added; 
						<span class="keyword">false</span> otherwise. 
					 </p>
 
				  </td>
 
				</tr>
 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d83130e114 "><span class="keyword">bool remove_successor(
						successor_type &amp;r ) = 0</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d83130e117 "> 
					 <p>A pure virtual method that describes the interface for
						removing a successor node from the set of successors for a sender. 
					 </p>
 
					 <p><strong>Returns</strong>: 
						<span class="keyword">true</span> if the successor is removed; 
						<span class="keyword">false</span> otherwise. 
					 </p>
 
				  </td>
 
				</tr>
 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d83130e114 "><span class="keyword">bool try_get( output_type &amp;v
						)</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d83130e117 "> 
					 <p>Requests an item from a sender. 
					 </p>
 
					 <p><strong>Returns</strong>: The default implementation returns 
						<span class="keyword">false</span>. 
					 </p>
 
				  </td>
 
				</tr>
 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d83130e114 "><span class="keyword">bool try_reserve( output_type
						&amp;v )</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d83130e117 "> 
					 <p>Reserves an item at the sender. 
					 </p>
 
					 <p><strong>Returns</strong>: The default implementation returns 
						<span class="keyword">false</span>. 
					 </p>
 
				  </td>
 
				</tr>
 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d83130e114 "><span class="keyword">bool try_release( )</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d83130e117 "> 
					 <p>Releases the reservation held at the sender. 
					 </p>
 
					 <p><strong>Returns</strong>: The default implementation returns 
						<span class="keyword">false</span>. 
					 </p>
 
				  </td>
 
				</tr>
 
				<tr> 
				  <td class="cellrowborder" valign="top" width="33.89830508474576%" headers="d83130e114 "><span class="keyword">bool try_consume( )</span> 
				  </td>
 
				  <td class="cellrowborder" valign="top" width="66.10169491525423%" headers="d83130e117 "> 
					 <p>Consumes the reservation held at the sender. 
					 </p>
 
					 <p><strong>Returns</strong>: The default implementation returns 
						<span class="keyword">false</span>. 
					 </p>
 
				  </td>
 
				</tr>
 
			 </tbody>
 
		  </table>
</div>
 
	 </div>
 
  </div>


<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../../reference/flow_graph.htm">Flow Graph</a></div>
</div>
<div></div>

</body>
</html>
